package com.example.demo.service;

import com.example.demo.dao.PrescribeDao;
import com.example.demo.pojo.Prescribe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("prescribeServiceImpl")
public class PrescribeServiceImpl implements PrescribeService{
    @Autowired
    private PrescribeDao prescribeDao;

    @Override
    public List<Prescribe> showAll(){
        List<Prescribe> allPrescribe = prescribeDao.selectPrescribe();
        return allPrescribe;
    }
    @Override
    public int addPrescribe(Prescribe prescribe){
        return prescribeDao.insertPrescribe(prescribe);
    }

    @Override
    public List<Prescribe> searchprescribe(int case_id) {
        return prescribeDao.selectPrescribeById(case_id);
    }
}
